import url from 'url';
const urlString = 'https://www.google.com/search?q=hello+world'
const urlobj = new URL(urlString);
console.log(urlobj);

console.log("将URL对象格式化为字符串：" + url.format(urlobj));

console.log("当前模块URL" + import.meta.url);
console.log("将文件URL转换为文件路径" + url.fileURLToPath(import.meta.url));

console.log("查询参数" + urlobj.search);
const params = new URLSearchParams(urlobj.search);
console.log(params.get('q'));

params.append('limit','5');
console.log(params);
params.delete('limit');
console.log(params);
